home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / viewkit / VCal / Info.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  1.8 KB  |  75 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. #ifndef _INFO_
  18. #define _INFO_
  19.  
  20. #include <stdio.h>
  21.  
  22. class Entry;
  23.  
  24. class Info {
  25. public:
  26.   Info();
  27.   ~Info();
  28.  
  29.   virtual int size();
  30.   virtual void rewind();
  31.   virtual Entry *nextEntry();
  32.  
  33.   Info *next() { return _next; }
  34.   void setNext(Info *n) { _next = n; }
  35.  
  36. protected:
  37.   int _size;
  38.   Info *_next;
  39. };
  40.  
  41.  
  42. class MemoryInfo : public Info {
  43. public:
  44.   MemoryInfo();
  45.   ~MemoryInfo();
  46.  
  47.   virtual void rewind();
  48.   virtual Entry *nextEntry();
  49.   virtual int readDay(FILE *fd, int version);
  50.   virtual void writeDay(FILE *fd, int annotate);
  51.  
  52.   void addEntry(Entry *entry);
  53.   int removeEntry(Entry *entry);
  54.   void clear();
  55.   void setDate(int day, int month, int year)
  56.     { _day = day; _month = month; _year = year; }
  57.   int day() { return _day; }
  58.   int month() { return _month; }
  59.   int year() { return _year; }
  60.   int sameDate(int day, int month, int year)
  61.     { return (_day == day && _month == month && _year == year); }
  62.   int annotate();
  63.  
  64.   MemoryInfo *next() { return (MemoryInfo *) _next; }
  65.   void setNext(MemoryInfo *n) { _next = n; }
  66.  
  67. protected:
  68.   void freeData();
  69.  
  70.   Entry *entries, *current;
  71.   int _day, _month, _year;
  72. };
  73.  
  74. #endif
  75.